﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SistemaAcademicoBO.Entities;
using SistemaAcademicoBO;
using SistemaAcademicoDAL;

namespace SistemaAcademicoBLL.Managers
{
    class StudentManager
    {
                private StudentsDAO studentDAO;

        public StudentManager()
        {
            studentDAO = new StudentsDAO();
        }

        public Student GetStudent(Guid id)
        {
            return (Student)studentDAO.GetRecord(id);
        }

        public List<Student> GetAllStudents()
        {
            List<IEntity> entityList = studentDAO.GetAllRecords();
            List<Student> studentList = new List<Student>();
            foreach (IEntity entity in entityList)
            {
                studentList.Add((Student)entity);
            }

            return studentList;
        }

        public void SetStudent(Student student)
        {
            studentDAO.SetRecord(student);
        }

        public void RemoveStudent(int id)
        {
            studentDAO.RemoveRecord(id);
        }
    }
}
